import ConfigUcharts from "@/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js";
import SlStyle from "@/sl-uni-sdk/style/style.js";

const color = [
	"#91CB74",
	"#1890FF",
	"#FAC858",
	"#EE6666",
	"#73C0DE",
	"#3CA272",
	"#FC8452",
	"#9A60B4",
	"#ea7ccc"
];

function yFormatter(v, i, opts) {
	return v;
}
Object.assign(ConfigUcharts, {
	pie: {
		"type": "pie",
		"canvasId": "",
		"canvas2d": true,
		"background": "none",
		"animation": true,
		"timing": "easeOut",
		"duration": 1000,
		"color": color,
		"padding": [
			0,
			0,
			0,
			0
		],
		"rotate": false,
		"errorReload": true,
		"fontSize": 13,
		"fontColor": "#666666",
		"enableScroll": false,
		"touchMoveLimit": 60,
		"enableMarkLine": false,
		"dataLabel": false,
		"dataPointShape": true,
		"dataPointShapeType": "solid",
		"tapLegend": true,
		"legend": {
			"show": false,
			"position": "bottom",
			"float": "center",
			"padding": 5,
			"margin": 5,
			"backgroundColor": "rgba(0,0,0,0)",
			"borderColor": "rgba(0,0,0,0)",
			"borderWidth": 0,
			"fontSize": 13,
			"fontColor": "#666666",
			"lineHeight": 11,
			"hiddenColor": "#CECECE",
			"itemGap": 10
		},
		"extra": {
			"pie": {
				"activeOpacity": 0.5,
				"activeRadius": 2,
				"offsetAngle": 0,
				"customRadius": 0,
				"labelWidth": 0,
				"border": true,
				"borderWidth": 0,
				"borderColor": "#FFFFFF",
				"linearType": "none"
			},
			"tooltip": {
				"showBox": true,
				"showArrow": false,
				"showCategory": false,
				"borderWidth": 0,
				"borderRadius": 0,
				"borderColor": "#000000",
				"borderOpacity": 0.7,
				"bgColor": "#000000",
				"bgOpacity": 0.7,
				"gridType": "solid",
				"dashLength": 4,
				"gridColor": "#E9EBEE",
				"fontColor": "#FFFFFF",
				"splitLine": true,
				"horizentalLine": false,
				"xAxisLabel": false,
				"yAxisLabel": false,
				"labelBgColor": "#FFFFFF",
				"labelBgOpacity": 0.7,
				"labelFontColor": "#666666"
			}
		}
	},
	"line": {
		"type": "line",
		"canvasId": "",
		"canvas2d": true,
		"background": "none",
		"animation": true,
		"timing": "easeOut",
		"duration": 1000,
		"color": color,
		"padding": [
			15,
			0,
			0,
			0
		],
		"rotate": false,
		"errorReload": true,
		"fontSize": 13,
		"fontColor": "#666666",
		"enableScroll": false,
		"touchMoveLimit": 60,
		"enableMarkLine": false,
		"dataLabel": false,
		"dataPointShape": true,
		"dataPointShapeType": "solid",
		"tapLegend": true,
		"xAxis": {
			"disabled": false,
			"axisLine": true,
			"axisLineColor": "#CCCCCC",
			"calibration": false,
			"fontColor": SlStyle.secondaryColor,
			"fontSize": 10,
			"rotateLabel": false,
			"itemCount": 5,
			"boundaryGap": "center",
			"disableGrid": true,
			"gridColor": "#E9EBEE",
			"gridType": "solid",
			"dashLength": 4,
			"gridEval": 1,
			"scrollShow": false,
			"scrollAlign": "left",
			"scrollColor": "#A6A6A6",
			"scrollBackgroundColor": "#EFEBEF",
			"format": ""
		},
		"yAxis": {
			"disabled": false,
			"disableGrid": false,
			"splitNumber": 5,
			"gridType": "solid",
			gridColor: "#E9EBEE",
			"dashLength": 2,
			"padding": 10,
			"showTitle": false,
			"data": [{
				min: 0
			}],
		},
		"legend": {
			"show": true,
			"position": "top",
			"float": "center",
			"padding": 5,
			"margin": 5,
			"backgroundColor": "rgba(0,0,0,0)",
			"borderColor": "rgba(0,0,0,0)",
			"borderWidth": 0,
			"fontSize": 13,
			"fontColor": "#666666",
			"lineHeight": 20,
			"hiddenColor": "#CECECE",
			"itemGap": 10
		},
		"extra": {
			"line": {
				"type": "curve",
				"width": 2
			},
			"tooltip": {
				"showBox": true,
				"showArrow": true,
				"showCategory": false,
				"borderWidth": 0,
				"borderRadius": 0,
				"borderColor": "#000000",
				"borderOpacity": 0.7,
				"bgColor": "#000000",
				"bgOpacity": 0.7,
				"gridType": "solid",
				"dashLength": 4,
				"gridColor": "#E9EBEE",
				"fontColor": "#FFFFFF",
				"splitLine": true,
				"horizentalLine": false,
				"xAxisLabel": false,
				"yAxisLabel": false,
				"labelBgColor": "#FFFFFF",
				"labelBgOpacity": 0.7,
				"labelFontColor": "#666666"
			},
			"markLine": {
				"type": "solid",
				"dashLength": 4,
				"data": []
			}
		}
	},
	"ring": {
		"type": "ring",
		"canvasId": "",
		"canvas2d": true,
		"background": "none",
		"animation": true,
		"timing": "easeOut",
		"duration": 1000,
		"color": color,
		"padding": [
			0,
			0,
			0,
			0
		],
		"rotate": false,
		"errorReload": true,
		"fontSize": 13,
		"fontColor": "#666666",
		"enableScroll": false,
		"touchMoveLimit": 60,
		"enableMarkLine": false,
		"dataLabel": true,
		"dataPointShape": true,
		"dataPointShapeType": "solid",
		"tapLegend": true,
		"legend": {
			"show": false,
			"position": "right",
			"float": "center",
			"padding": 5,
			"margin": 5,
			"backgroundColor": "rgba(0,0,0,0)",
			"borderColor": "rgba(0,0,0,0)",
			"borderWidth": 0,
			"fontSize": 13,
			"fontColor": "#666666",
			"lineHeight": 25,
			"hiddenColor": "#CECECE",
			"itemGap": 10
		},
		"title": {
			"name": "",
			"fontSize": 15,
			"color": "#666666",
			"offsetX": 0,
			"offsetY": 0
		},
		"subtitle": {
			"name": "",
			"fontSize": 25,
			"color": "#7cb5ec",
			"offsetX": 0,
			"offsetY": 0
		},
		"extra": {
			"ring": {
				"ringWidth": 14,
				"centerColor": "#FFFFFF",
				"activeOpacity": 0.5,
				"activeRadius": 10,
				"offsetAngle": 0,
				"customRadius": 0,
				"labelWidth": 10,
				"border": true,
				"borderWidth": 3,
				"borderColor": "#FFFFFF",
				"linearType": "none"
			},
			"tooltip": {
				"showBox": true,
				"showArrow": true,
				"showCategory": true,
				"borderWidth": 0,
				"borderRadius": 0,
				"borderColor": "#000000",
				"borderOpacity": 0.7,
				"bgColor": "#000000",
				"bgOpacity": 0.7,
				"gridType": "solid",
				"dashLength": 4,
				"gridColor": "#E9EBEE",
				"fontColor": "#FFFFFF",
				"splitLine": true,
				"horizentalLine": false,
				"xAxisLabel": false,
				"yAxisLabel": false,
				"labelBgColor": "#FFFFFF",
				"labelBgOpacity": 0.7,
				"labelFontColor": "#666666"
			}
		}
	},
	"column": {
		"canvas2d": true,
		"type": "column",
		"color": color,
		"padding": [0, 0, 0, 0],
		"xAxis": {
			"disableGrid": true,
		},
		"yAxis": {
			"gridType": "solid",
			gridColor: "#E9EBEE",
			"data": [{
				"min": 0
			}]
		},
		"legend": {
			position: "top",
		},
		"extra": {
			"column": {
				"type": "group",
				"width": 16,
				seriesGap: 8,
				"activeBgColor": "#000000",
				"activeBgOpacity": 0.08
			},
		}
	},
	"area": {
		"canvas2d": true,
		"type": "area",
		"color": color,
		"padding": [5, 20, 0, 15],
		"xAxis": {
			"disableGrid": true,
		},
		"yAxis": {
			"gridType": "solid",
			gridColor: "#E9EBEE",
			"dashLength": 2,
			formatter: yFormatter,
		},
		"legend": {
			position: "top"
		},
		"extra": {
			"area": {
				"type": "curve",
				"opacity": 0.2,
				"addLine": true,
				"width": 2,
				"gradient": false
			},
		}
	},
});

export default ConfigUcharts;
